package es.yporqueno.cargadores {
	
	import flash.display.DisplayObject;
	import flash.display.LoaderInfo;
	import flash.events.Event;
	import flash.net.URLRequest;
	import flash.system.LoaderContext;
	

	public class CargadorSwf extends AbstractCargadorObjetos {

		public function CargadorSwf() {
			super();
			super.init();
			_type = CargadorDataTypes.SWF;
		}
		
		
		public function load(url:String, alineacion:String = "TOP_LEFT", context:LoaderContext = null):void {
			_posV = alineacion.split("_")[0];
			_posH = alineacion.split("_")[1];

			var req:URLRequest = new URLRequest(url);
			
			_loader.load(req, context);
		}
		
		// Funciones Privadas -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		override protected function loaderComplete(e:Event):void {
			_data = LoaderInfo(e.target).content as DisplayObject;
			super.loaderComplete(e);
		}
	}
}